import {
	ddLogin
} from '@/api/login.js'
import {
	setToken
} from '@/utils/auth.js'

export function login() {
	uni.getProvider({
		service: 'oauth'
	}).then(res => {
		let provider = res[1].provider[0]
		console.log(provider)
		uni.login({
			provider: provider,
		}).then(res => {
			ddLogin({
				code: res[1].code
			}).then(res => {
				setToken(res.token)

			})
		})
	})
}